package com.zmn.mcc.dubbo;

import com.github.ltsopensource.spring.boot.annotation.EnableJobClient;
import com.github.ltsopensource.spring.boot.annotation.EnableTaskTracker;
import com.zmn.manager.common.database.config.OneMasterMultiSlaveDataSourceConfiguration;
import com.zmn.manager.mq.annotation.EnableMQConsume;
import com.zmn.manager.mq.annotation.EnableMQSend;
import org.apache.dubbo.config.spring.context.annotation.DubboComponentScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @uthor heguanghua
 * @since 2020/04/09 18:39
 */
@EnableCaching
@EnableTransactionManagement
@SpringBootApplication(scanBasePackages = {"com.zmn.mcc", "com.zmn.base.plat.engine.anole"}, exclude = {DataSourceAutoConfiguration.class})
@Import({OneMasterMultiSlaveDataSourceConfiguration.class})
@DubboComponentScan(basePackages = "com.zmn.mcc.dubbo")
@EnableTaskTracker
@EnableJobClient
@EnableMQConsume
@EnableMQSend
public class DubboApplication {

    private final static Logger logger = LoggerFactory.getLogger(DubboApplication.class);

    public static void main(String[] args) {
        try {
            SpringApplication.run(DubboApplication.class, args);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
    }
}